A Certified JavaScript Interpreter
نویسندگان
چکیده
The JavaScript language was initially developed for web pages enrichment, allowing the execution of scripts by the browser. It is now pervasively used on the web, not only to add interactivity in websites or to embed contents from third-party sources, but also as a target platform for deploying applications written in other languages (such as ocaml bytecode [VB11], Hop [SGL06], or LLVM assembly [Zak11]). In some sense, JavaScript has become the assembly language of the web, as most browsers are now able to run it. More recently, it has been used to program user interfaces for embedded systems, such as the defunct WebOS (now Enyo [Eny12]), the Kindle Touch ebook reader, or for the BootToGecko project [Moz12]. In addition to its pervasive use, JavaScript presents two important characteristics. First, as it was initially developed to facilitate its integration with the browser and with web contents, it aims more at providing powerful features than at giving robustness and safety guarantees. These powerful features include first class functions and closures, prototype-based objects, dynamic typing with many conversion functions, explicit scope manipulation, and the evaluation of strings as code. A second, redeeming, characteristic of JavaScript is that it is standardized [A99], providing more information about how these features interact. The goal of the JSCert project [BCF12] is to provide a precise and formal semantics to JavaScript to build tools to certify analyses and compilation procedures. JSCert’s collaborators have defined such a semantics in the Coq proof assistant, based both on the paper formalization of Maffeis et al. [MMT11, MMT08] and on the specification. To gain and provide more confidence in this formalization, we have implemented an interpreter that is proven correct in relation to the semantics. We will thus be able to confront our semantics against JavaScript test suites. This paper describes the design and implementation of the interpreter. It is organized as follows. Section 1 introduces the semantics of JavaScript and highlights some of its peculiarities. Section 2 describes the interpreter’s design and implementation. Section 3 addresses the interpreter’s correctness. Finally, Section 4 concludes with future and related work.
منابع مشابه
The Debuggable Interpreter Design Pattern
The use of Interpreter and Visitor design patterns has been widely adopted to implement programming language interpreters due to their expressive and simple design. However, no general approach to conceive a debugger is commonly adopted. This paper presents the debuggable interpreter design pattern as a general approach to extend a language interpreter with debugging facilities such as step-ove...
متن کاملImplementing a performant scheme interpreter for the web in asm.js
This paper presents the implementation of an efficient interpreter for a Schemelike language using manually written asm.js code. The asm.js specification defines an optimizable subset of JavaScript which has already served well as a compilation target for web applications where performance is critical. However, its usage as a human-writable language that can be integrated into existing projects...
متن کاملFuzzing with Code Fragments (-2)
Fuzz testing is an automated technique providing random data as input to a software system in the hope to expose a vulnerability. In order to be effective, the fuzzed input must be common enough to pass elementary consistency checks; a JavaScript interpreter, for instance, would only accept a semantically valid program. On the other hand, the fuzzed input must be uncommon enough to trigger exce...
متن کاملA Study of the JavaScript Compiler and Symbol Table for the Smart Cross Platform
Smart Cross Platform (SCP) is virtual machine based solution that supports various programming languages and platforms, and its aims are to support programming languages like ISO/IEC C++, Java and Objective C and smartphone platforms such as Android and iOS. Java Script is a programming language to develop HTML5 contents, and the contents are executed by interpreter which included in web browse...
متن کاملInformation Flow Control in WebKit's JavaScript Bytecode
Websites today routinely combine JavaScript from multiple sources, both trusted and untrusted. Hence, JavaScript security is of paramount importance. A specific interesting problem is information flow control (IFC) for JavaScript. In this paper, we develop, formalize and implement a dynamic IFC mechanism for the JavaScript engine of a production Web browser (specifically, Safari’s WebKit engine...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013